<template>
    <div class="muduleFilterTab">
        <div class="tab_wrap" :class="{ 'active': filterVal == item.value }" v-for="(item,index) in data" :key="index" @click="filterBtn(item)">{{ item.name }}</div>
    </div>
</template>

<script>
export default {
	name: 'app-filter-tab',
	props: {
		data: {
			type: Array,
			default: () => []
		},
		filterVal: {
			type: Number,
			default: 0
		}
	},
	data() {
		return {}
	},
	methods: {
		// 筛选按钮
		filterBtn(item) {
			this.$emit('filterBtn', item)
		}
	}
}
</script>

<style lang="scss" scoped>
.muduleFilterTab {
    @include disFlexCen();
    font-size: 24px;
    color: $fontColor2;
    border-radius: 50px;
    .tab_wrap {
        padding: 8px 22px;
        border: 1px solid $borderColorMain; /*no*/
        border-left: 0;
    }
    .tab_wrap:first-child {
        border-left: 1px solid $borderColorMain; /*no*/
        border-top-left-radius: 50px;
        border-bottom-left-radius: 50px;
    }
    .tab_wrap:last-child {
        border-top-right-radius: 50px;
        border-bottom-right-radius: 50px;
    }
    .tab_wrap.active {
        border: 1px solid $mainColor !important; /*no*/
        color: $auxiliaryColor1;
        background-color: $mainColor;
    }
}
</style>
